<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <title>index1</title>
  <!-- 引入Vue -->
  <script type="text/javascript" src="../../js/vue.js"></script>
</head>

<body>
  <!-- 准备好一个容器-->
  <div id="demo">
  </div>
</body>

<script type="text/javascript">
  let School = Vue.extend({
    data() {
      return {
        school: '中央戏剧学院',
        address: '北京昌平'
      }
    },
    methods: {
      showSchool() {
        alert(`${this.school},坐落于${this.address}`)
      }
    },
    template: `
      <div>
        <h2>学院的信息</h2>
        <h2>名称:{{school}}</h2>
        <h2>地址:{{address}}</h2>
        <input type="submit" @click="showSchool">
      </div>
    `
  });
  let App = Vue.extend({
    name: 'App',
    components: { School },
    template: `
          <div>
            <School/>
          </div>
    `
  })
  new Vue({
    el: '#demo',
    components: { App },
    template: `
      <App/>
    `
  })
</script>

</html>